//////////Change the directory before running the code
////////////////// No-show
cd "D:\data&code"
use pseudo_dataset/noshow, clear
				
//// Probit
xi: probit no_show 			///
		   logmv   			///
		   q_CCM   			///
		   roa 				///
		   leverage 		///
		   divyld			///
		   hhi				///
		   inst_13f 		///
		   hf				///
		   no_camp			///
		   share_intensity 	///
		   log_port_val 	///
		   port_share	    ///
		   stance_fund_fe 	///
		   horizon    		///
		   basis_ret 	    ///
		   passive 			///
		   pa_for_diss 		///
		   i.proxy_year		///
		   i.ff48,          ///
		   vce(cluster fund_family_id)

		   	summarize no_show if e(sample)
		   
outreg2 using table_11,  						///
		dta 									///
		tstat 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		nonotes 								///
		addstat(Pseudo R-squared, `e(r2_p)') 	///
		label 									///
		keep ( 									///
			logmv              					///
			q_CCM       	        			///
			roa_CCM                 			///
			leverage_CCM            			///
			divyld_CCM              			///
			hhi 								///
			inst_13f 							///
			hf  								///
			no_camp 							///
			share_intensity 					///
			log_port_val		 				///
			port_share							///	
			stance_fund_fe 				        ///
		    horizon    							///
		    basis_ret 	    					///
		    passive 							///
		    pa_for_diss 						///			
		)               						/// 
		replace 		
	


/////////////////// Buy-in
use pseudo_dataset/buyin, clear

/// Probit
xi: probit 	buyin 				///
			logmv 				///
			q_CCM 				///
			roa 				///
			leverage			///
			divyld 				///
			hhi					///
			inst_13f 			///
			hf 					///
			no_camp 			///
			share_intensity 	///
			log_port_val 		///
			port_share 			///
			stance_fund_fe 		///
			i.proxy_year 		///
			i.ff48, 			///
			vce(cluster fund_family_id)	

					   	summarize buyin if e(sample)
			
outreg2 using table_11,  						///
		dta 									///
		tstat 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		nonotes 								///
		addstat(Pseudo R-squared, `e(r2_p)') 	///
		label 									///
		keep ( 									///
			logmv              					///
			q_CCM       	        			///
			roa_CCM                 			///
			leverage_CCM            			///
			divyld_CCM              			///
			hhi 								///
			inst_13f 							///
			hf  								///
			no_camp 							///
			share_intensity 					///
			log_port_val		 				///
			port_share							///	
			stance_fund_fe 				        ///			
		)               						/// 
		append

		/////////////////// Buy-in KY
use pseudo_dataset/buyin, clear

/// Probit
xi: probit 	buyin_out4ky 				///
			logmv 				///
			q_CCM 				///
			roa 				///
			leverage			///
			divyld 				///
			hhi					///
			inst_13f 			///
			hf 					///
			no_camp 			///
			share_intensity 	///
			log_port_val 		///
			port_share 			///
			stance_fund_fe 		///
			i.proxy_year 		///
			i.ff48, 			///
			vce(cluster fund_family_id)	

summarize buyin_out4ky if e(sample)
			
outreg2 using table_11,  						///
		dta 									///
		tstat 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		nonotes 								///
		addstat(Pseudo R-squared, `e(r2_p)') 	///
		label 									///
		keep ( 									///
			logmv              					///
			q_CCM       	        			///
			roa_CCM                 			///
			leverage_CCM            			///
			divyld_CCM              			///
			hhi 								///
			inst_13f 							///
			hf  								///
			no_camp 							///
			share_intensity 					///
			log_port_val		 				///
			port_share							///	
			stance_fund_fe 				        ///			
		)               						/// 
		append
		
		
/////////////////// Sell-out
use pseudo_dataset/sellout, clear

/// Probit
xi: probit 	sellout 			///
			logmv 				///
			q_CCM 				///
			roa 				///
			leverage			///
			divyld 				///
			hhi					///
			inst_13f 			///
			hf 					///
			no_camp 			///
			share_intensity 	///
			log_port_val 		///
			port_share			///
			stance_fund_fe 		///
			horizon 			///
			basis_ret 			///
			i.proxy_year 		///
			i.ff48, 			///
			vce(cluster fund_family_id)	

			summarize sellout if e(sample)
			
outreg2 using table_11,  						///
		dta 									///
		tstat 									///
		bdec(3) 								///
		tdec(2)  								///
		bracket 								///
		nocons 									///
		nonotes 								///
		addstat(Pseudo R-squared, `e(r2_p)') 	///
		label 									///
		keep ( 									///
			logmv              					///
			q_CCM       	        			///
			roa_CCM                 			///
			leverage_CCM            			///
			divyld_CCM              			///
			hhi 								///
			inst_13f 							///
			hf  								///
			no_camp 							///
			share_intensity 					///
			log_port_val		 				///
			port_share							///	
			stance_fund_fe 				        ///
		    horizon    							///
		    basis_ret 	    					///		
		)               						/// 
		append 

//////////
use table_11_dta, clear
rm table_11.txt
browse
	
